package com.diankangwo.test;

import com.diankangwo.upyun.demo.PicBucketDemo;
import com.diankangwo.util.QRCoderUtil;
import com.google.zxing.WriterException;

import java.io.File;

public class test {
    public static void main(String[] args) {
//        Properties prop = LoadPropertyUtil.loadProperty("beecloudPay.properties");
//        // 获取项目 APP ID 和 APP Secret
//        String appID = prop.get("appId").toString();
//        String appSecret = prop.get("appSecret").toString();
//        String MasterSecret = prop.get("MasterSecret").toString();
//        String TestSecret = prop.get("TestSecret").toString();
//        BeeCloud bc = new BeeCloud();
//        bc.registerApp(appID,TestSecret,appSecret,MasterSecret);
//
//        BCOrder bcOrder = new BCOrder(BCEumeration.PAY_CHANNEL.ALI_WEB,1234, OrderUtil.getOrderNo(),"test");
//        bcOrder.setReturnUrl("wwww.baidu.com");
//        try {
//            bcOrder = BCPay.startBCPay(bcOrder);
//            BCBillConfirm bcbc = new BCBillConfirm("",bcOrder.getObjectId(),"");
//            System.out.println(BCPay.billConfirm(bcbc));
//        }catch (Exception e){
//            e.printStackTrace();
//        }

//        System.out.println(System.getProperty("user.dir"));

        String path = System.getProperty("user.dir");
        QRCoderUtil util = new QRCoderUtil();
        try {
            String fileName = System.currentTimeMillis() + "";
            String url = util.encoderQRCoderFile("www.baidu.com", path);
            File file = new File(url);
            System.out.println(PicBucketDemo.WriteFile("/qrcode/", file,fileName));
        } catch (WriterException e) {
            e.printStackTrace();
        }


    }
}
